<?php

class Genzong extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model("base_model");
        $this->load->model("order_model");
        $this->load->model("custom_model");
        $this->load->model("car_model");
        $this->load->model("custom_address_model");
        $this->load->model("province_model");
        $this->load->model("city_model");
        $this->load->model("district_model");
        $this->load->model("admin_user_model");
        $this->load->model("admin_role_model");
        $this->load->model("driver_model");
        $this->load->model("order_fee_model");
        $this->load->model("order_genjin_model");
        $this->load->model("order_genzong_model");

        $this->load->service("baidu_fanyi_api_service");

        $this->load->service("admin_manage_service");
        $this->check = $this->admin_manage_service;
        $this->_adminInfo = $this->check->checkAdminLogin();
        #

        $this->projectSet = [
            "url" => [
                "editStatus" => MANAGE_URL . "&c=genzong&m=editStatus",
                "doEditStatus" => MANAGE_URL . "&c=genzong&m=doEditStatus",
                "backStatus" => MANAGE_URL . "&c=genzong&m=backStatus",
                "doBackStatus" => MANAGE_URL . "&c=genzong&m=doBackStatus",
                "viewGenjin" => MANAGE_URL . "&c=genzong&m=viewGenjin",
                "addGenjin" => MANAGE_URL . "&c=genzong&m=addGenjin",
                "doAddGenjin" => MANAGE_URL . "&c=genzong&m=doAddGenjin",
                "list" => MANAGE_URL . "&c=genzong&m=lists",
                "doSelectIds" => MANAGE_URL . "&c=genzong&m=doSelectIds",
            ],
            "file" => [
                "view" => "admin/genzong",
                "js" => "admin/js/genzong",
                "cache_ids_name" => "cache_genzong_ids",
                "power_name" => "genzong"
            ],
        ];
    }

    /*
     * 列表
     */

    function lists() {

        try {

            #权限
            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_view"));

            $data["navName"] = "货况跟踪";

            $page = $this->input->getInt("page", TRUE);
            if ($page <= 0) {
                $page = 1;
            }
            $pageCount = $this->input->getInt("limit", TRUE);
            if ($pageCount <= 0) {
                $pageCount = 50;
            }
            if ($pageCount >= 200) {
                $pageCount = 200;
            }
            $data["page"] = $page;
            $data["pageCount"] = $pageCount;

            $first = $this->input->getInt("first", true);
            if ($first == 1) {
                $this->session->unset_userdata([$this->projectSet["file"]["cache_ids_name"]]);
            }

            $searchParam = $this->_searchParam();
            $where = $searchParam["where"];
            $pageStrArr = $searchParam["pageStrArr"];
            foreach ($searchParam["data"] as $k => $v) {
                ${$k} = $v;
                $data[$k] = $v;
            }

            $type = $this->order_model->type();
            $data["type"] = $type;

            $secondType = $this->order_model->secondType();
            $data["secondType"] = $secondType;

            $status = $this->order_model->status();
            $data["status"] = $status;

            $completeStatus = $this->order_model->completeStatus();
            $data["completeStatus"] = $completeStatus;

            $isHuicheng = $this->order_model->isHuicheng();
            $data["isHuicheng"] = $isHuicheng;

            $carType = $this->car_model->carType();

            $data["kehu"] = $this->custom_model->getData("where type_id=2 and status_id=1", 1, 0);
            $data["diaodu"] = $this->base_model->getData("select au.* from " . $this->admin_user_model->tableName . " au left join " . $this->admin_role_model->tableName . " ar on au.role_id=ar.id where ar.type_id=1 and au.status_id=1", 1, 0, " order by au.id desc");
            $data["car"] = $this->car_model->getData("where status_id=1", 1, 0);

            $province = $this->province_model->getDataSetKey();
            //$city = $this->city_model->getDataSetKey();
            //$district = $this->district_model->getDataSetKey();

            $sql = " from " . $this->order_model->tableName . " o";
            $sql .= " left join " . $this->car_model->tableName . " c on o.car_id=c.id";
            $sql .= " left join " . $this->custom_model->tableName . " ct on o.kehu_custom_id=ct.id";
            $sql .= " left join " . $this->admin_user_model->tableName . " diaodu on o.diaodu_user_id=diaodu.id";
            $sql .= " left join " . $this->admin_user_model->tableName . " cwjl on o.cwjl_user_id=cwjl.id";
            $sql .= " left join " . $this->driver_model->tableName . " zhujia on o.zhujia_driver_id=zhujia.id";
            $sql .= " left join " . $this->driver_model->tableName . " fujia on o.fujia_driver_id=fujia.id";

            $listNum = $this->base_model->getDataCount("select o.id" . $sql . " " . $where);

            $is_ajax = $this->input->is_ajax_request();
            if ($is_ajax) {


                $dataList = $this->base_model->getData("select o.*,ct.cmp_bf as ct_cmp_bf,diaodu.truename as diaodu_truename,cwjl.truename as cwjl_truename,c.car_number as c_car_number,c.car_type as c_car_type,zhujia.driver_name as zhujia_driver_name,zhujia.tel as zhujia_tel,fujia.driver_name as fujia_driver_name,fujia.tel as fujia_tel" . $sql . " " . $where, $page, $pageCount);

                foreach ($dataList as $k => $v) {
                    $dataList[$k]["created_at_alias"] = date("Y-m-d H:i:s", $v["created_at"]);
                    $dataList[$k]["updated_at_alias"] = date("Y-m-d H:i:s", $v["updated_at"]);
                    $dataList[$k]["type_name"] = $type[$v["type_id"]]["name"];
                    $dataList[$k]["type_name"] .= $v["second_type_id"] > 0 ? "-" . $secondType[$v["second_type_id"]]["name"] : "";
                    $dataList[$k]["status_name"] = $status[$v["status_id"]]["name"];
                    $dataList[$k]["order_date_alias"] = date("Y-m-d", $v["order_date"]);

                    $org_province = !empty($province[$v["org_province_id"]]) ? $province[$v["org_province_id"]]["name"] : "";
                    //$org_city = !empty($city[$v["org_city_id"]]) ? $city[$v["org_city_id"]]["name"] : "";
                    //$org_district = !empty($district[$v["org_district_id"]]) ? $province[$v["org_district_id"]]["name"] : "";
                    //$dataList[$k]["org_tag"] = $org_province . "/" . $org_city . "/" . $v["org_address"];
                    $dataList[$k]["org_tag"] = $org_province . "/" . $v["org_address"];

                    $dest_province = !empty($province[$v["dest_province_id"]]) ? $province[$v["dest_province_id"]]["name"] : "";
                    //$dest_city = !empty($city[$v["dest_city_id"]]) ? $city[$v["dest_city_id"]]["name"] : "";
                    //$dest_district = !empty($district[$v["dest_district_id"]]) ? $district[$v["dest_district_id"]]["name"] : "";
                    //$dataList[$k]["dest_tag"] = $dest_province . "/" . $dest_city . "/" . $v["dest_address"];
                    $dataList[$k]["dest_tag"] = $dest_province . "/" . $v["dest_address"];

                    $dataList[$k]["c_car_type_name"] = !empty($carType[$v["c_car_type"]]) ? $carType[$v["c_car_type"]]["name"] : "";
                    $dataList[$k]["xianghao_tag"] = $v["xianghao"] . ($v["xianghao2"] ? "," . $v["xianghao2"] : "");

                    $dataList[$k]["setting_off_at_alias"] = $v["setting_off_at"] > 0 ? date("m/d H:i", $v["setting_off_at"]) : "";
                    $dataList[$k]["arrived_at_alias"] = $v["arrived_at"] > 0 ? date("m/d H:i", $v["arrived_at"]) : "";
                    $dataList[$k]["loading_at_alias"] = $v["loading_at"] > 0 ? date("m/d H:i", $v["loading_at"]) : "";
                    $dataList[$k]["delivering_at_alias"] = $v["delivering_at"] > 0 ? date("m/d H:i", $v["delivering_at"]) : "";
                    $dataList[$k]["at_delivery_at_alias"] = $v["at_delivery_at"] > 0 ? date("m/d H:i", $v["at_delivery_at"]) : "";
                    $dataList[$k]["off_loading_at_alias"] = $v["off_loading_at"] > 0 ? date("m/d H:i", $v["off_loading_at"]) : "";
                    $dataList[$k]["completed_at_alias"] = $v["completed_at"] > 0 ? date("m/d H:i", $v["completed_at"]) : "";
                    $latest_genjin = jsonDecode($v["latest_genjin"]);
                    $dataList[$k]["latest_genjin_tag"] = !empty($latest_genjin[$language_id]) ? $latest_genjin[$language_id] : "-";
                }
                $data["dataList"] = $dataList;

                $result = [
                    "code" => 0,
                    "count" => $listNum,
                    "data" => $dataList,
                    "msg" => ""
                ];
                echo jsonEncode($result);
                exit;
            }

            #进行分页
            $pageStr = "";
            if (!empty($pageStrArr)) {
                foreach ($pageStrArr as $k => $v) {
                    $pageStr .= "&" . $k . "=" . $v;
                }
            }
            $data['base_url'] = $this->projectSet["url"]["list"] . $pageStr;

            $data["listNum"] = $listNum;
            $data["pageStr"] = $pageStr;

            $this->layout->view($this->projectSet["file"]["view"] . '/list', $data);
        } catch (Exception $e) {
            show_error($msg = $e->getMessage(), $e->getCode() ? $e->getCode() : 200, "系统提示");
        }
    }

    public function _searchParam() {

        $pageStrArr = array();

        $where = "where o.pending_vehicle_at>0";
        if ($this->_adminInfo["role"]["type_id"] == 2) {
            $where .= " and o.cwjl_user_id=" . $this->_adminInfo["id"];
        }

        $status_id = $this->input->getPostStr("status_id", TRUE);
        if ($status_id != "") {
            $pageStrArr["status_id"] = $status_id;
            $where .= " AND o.status_id = '" . $status_id . "'";
        }
        $data["status_id"] = $status_id;

        $type_id = $this->input->getPostInt("type_id", TRUE);
        if ($type_id > 0) {
            $pageStrArr["type_id"] = $type_id;
            $where .= " AND o.type_id = " . $type_id;
        }
        $data["type_id"] = $type_id;

        $second_type_id = $this->input->getPostInt("second_type_id", TRUE);
        if ($second_type_id > 0) {
            $pageStrArr["second_type_id"] = $second_type_id;
            $where .= " AND o.second_type_id = " . $second_type_id;
        }
        $data["second_type_id"] = $second_type_id;

        $car_id = $this->input->getPostInt("car_id", TRUE);
        if ($car_id > 0) {
            $pageStrArr["car_id"] = $car_id;
            $where .= " AND o.car_id = " . $car_id;
        }
        $data["car_id"] = $car_id;

        $order_date_range = $this->input->getPostStr("order_date_range", TRUE);
        if ($order_date_range === null) {
            $order_date_range = date("Y-m-d", strtotime("-29 days")) . " - " . date("Y-m-d");
        }
        if ($order_date_range != "") {
            $order_date_range_arr = explode(" - ", $order_date_range);
            $order_date_start = strtotime($order_date_range_arr[0]);
            $where .= " AND o.order_date >=" . $order_date_start;
            $order_date_end = strtotime($order_date_range_arr[1]) + 3600 * 24;
            $where .= " AND o.order_date <" . $order_date_end;
        }
        $pageStrArr["order_date_range"] = $order_date_range;
        $data["order_date_range"] = $order_date_range;

        $order_no = $this->input->getPostStr("order_no", TRUE);
        if ($order_no != "") {
            $pageStrArr["order_no"] = $order_no;
            $where .= " AND o.order_no like '%" . $order_no . "%'";
        }
        $data["order_no"] = $order_no;

        $language_id = $this->input->getPostInt("language_id", TRUE) ? $this->input->getPostInt("language_id", TRUE) : 1;
        if ($language_id > 0) {
            $pageStrArr["language_id"] = $language_id;
        }
        $data["language_id"] = $language_id;

        $is_huicheng = $this->input->getPostStr("is_huicheng", TRUE);
        if ($is_huicheng !== null && $is_huicheng !== "") {
            $pageStrArr["is_huicheng"] = $is_huicheng;
            $where .= " AND is_huicheng = " . $is_huicheng;
        }
        $data["is_huicheng"] = $is_huicheng;

        $kehu_custom_id = $this->input->getPostInt("kehu_custom_id", TRUE);
        if ($kehu_custom_id > 0) {
            $pageStrArr["kehu_custom_id"] = $kehu_custom_id;
            $where .= " AND o.kehu_custom_id = " . $kehu_custom_id;
        }
        $data["kehu_custom_id"] = $kehu_custom_id;

        $diaodu_user_id = $this->input->getPostInt("diaodu_user_id", TRUE);
        if ($diaodu_user_id > 0) {
            $pageStrArr["diaodu_user_id"] = $diaodu_user_id;
            $where .= " AND o.diaodu_user_id = " . $diaodu_user_id;
        }
        $data["diaodu_user_id"] = $diaodu_user_id;

        $complete_status = $this->input->getPostInt("complete_status", TRUE);
        if ($complete_status > 0) {
            if ($complete_status == 1) {
                $where .= " AND o.status_id = 'completed'";
            }
            if ($complete_status == 2) {
                $where .= " AND o.status_id not in('completed')";
            }
            $pageStrArr["complete_status"] = $complete_status;
        }

        $data["complete_status"] = $complete_status;

        return [
            "data" => $data,
            "pageStrArr" => $pageStrArr,
            "where" => $where,
        ];
    }

    public function doSelectIds() {

        #权限
        //$this->check->checkPower(array("power" => "idcard_edit", "ajax" => 1));

        $flag = 0;
        $msg = "操作失败";
        $id_arr = $this->input->postStr("ids", TRUE, false);

        try {
            $sessionData = [
                $this->projectSet["file"]["cache_ids_name"] => $id_arr,
            ];
            $this->session->set_userdata($sessionData);

            $flag = 1;
            $msg = "操作成功";
            //事务结束
        } catch (Exception $e) {
            $msg = $e->getMessage();
        }
        $outArr = array("flag" => $flag, "msg" => $msg);
        echo jsonEncode($outArr);
    }

    /*
     * 
     */

    function editStatus() {

        try {

            #权限
            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_editStatus"));

            $data["navName"] = "编辑";

            $id = $this->input->getInt("id", TRUE);
            $editData = $this->order_model->getDataById($id);
            if (empty($editData)) {
                throw new Exception("没有此数据");
            }
            $status = $this->order_model->status();
            $editData["status_name"] = $status[$editData["status_id"]]["name"];

            if ($editData["status_id"] == "created") {
                throw new Exception("该订单还未派车，不可更新");
            }
            if (in_array($status[$editData["status_id"]]["sort_id"], [1, 9])) {
                throw new Exception("当前状态无需更新");
            }

            $statusTime = array_column($status, null, "sort_id");
            $data["editStatus"] = $statusTime[$status[$editData["status_id"]]["sort_id"] + 1];

            //print_r($data["editStatus"]);

            $data["editData"] = $editData;

            $data["doAddUrl"] = $this->projectSet["url"]["doEditStatus"];

            $this->layout->view($this->projectSet["file"]["view"] . '/editStatus', $data);
        } catch (Exception $e) {
            show_error($msg = $e->getMessage(), $e->getCode() ? $e->getCode() : 200, "系统提示");
        }
    }

    /*
     * 
     */

    function doEditStatus() {

        $flag = 0;
        $msg = "操作失败";

        try {

            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_editStatus",));

            $status_id = $this->input->postStr("status_id", TRUE);
            if ($status_id == "") {
                throw new Exception("缺少需更新的状态ID");
            }
            $status_at = $this->input->postStr("status_at", TRUE);
            if ($status_at == "") {
                throw new Exception("状态时间为空");
            }
            $status_at = strtotime($status_at);
            if ($status_at <= 0) {
                throw new Exception("状态时间有误");
            }

            $id = $this->input->postInt("id", TRUE);

            $oldData = $this->order_model->getDataById($id);
            if (empty($oldData)) {
                throw new Exception("数据不存在");
            }
            $old_status_at_field = $oldData["status_id"] . "_at";
            if ($status_at < $oldData[$old_status_at_field]) {
                throw new Exception("更新状态时间不能小于上一状态时间");
            }

            $this->db->trans_start();

            $data = [
                "fieldArr" => [
                    "status_id" => $status_id,
                    $status_id . "_at" => $status_at,
                    "updated_at" => time(),
                ],
                "whereArr" => [
                    "id" => $id,
                ],
            ];
            $this->order_model->updateData($data);

            $status = $this->order_model->status();

            $this->order_genzong_model->addData([
                "order_id" => $id,
                "status_id" => $status_id,
                "status_at" => $status_at,
                "status_desc" => $status[$status_id]["name"],
                "created_user_id" => $this->_adminInfo["id"],
                "created_at" => time(),
                "updated_at" => time(),
            ]);

            $flag = 1;
            $msg = "操作成功";

            $this->db->trans_complete();
        } catch (Exception $e) {
            $msg = $e->getMessage();
        }

        $outArr = array("flag" => $flag, "msg" => $msg);
        echo jsonEncode($outArr);
    }

    /*
     * 
     */

    function backStatus() {

        try {

            #权限
            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_backStatus"));

            $data["navName"] = "编辑";

            $id = $this->input->getInt("id", TRUE);
            $editData = $this->order_model->getDataById($id);
            if (empty($editData)) {
                throw new Exception("没有此数据");
            }
            $status = $this->order_model->status();
            $editData["status_name"] = $status[$editData["status_id"]]["name"];

            if (in_array($status[$editData["status_id"]]["sort_id"], [1, 2])) {
                throw new Exception("当前状态无需更新");
            }

            $statusTime = array_column($status, null, "sort_id");
            $data["editStatus"] = $statusTime[$status[$editData["status_id"]]["sort_id"] - 1];

            //print_r($data["editStatus"]);

            $data["editData"] = $editData;

            $data["doAddUrl"] = $this->projectSet["url"]["doBackStatus"];

            $this->layout->view($this->projectSet["file"]["view"] . '/backStatus', $data);
        } catch (Exception $e) {
            show_error($msg = $e->getMessage(), $e->getCode() ? $e->getCode() : 200, "系统提示");
        }
    }

    /*
     * 
     */

    function doBackStatus() {

        $flag = 0;
        $msg = "操作失败";

        try {

            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_editStatus",));

            $status_id = $this->input->postStr("status_id", TRUE);
            if ($status_id == "") {
                throw new Exception("缺少需返回的状态ID");
            }

            $id = $this->input->postInt("id", TRUE);

            $oldData = $this->order_model->getDataById($id);
            if (empty($oldData)) {
                throw new Exception("数据不存在");
            }
            $old_status_at_field = $oldData["status_id"] . "_at";
//            if ($status_at < $oldData[$old_status_at_field]) {
//                throw new Exception("更新状态时间不能小于上一状态时间");
//            }
            $old_status_id = $oldData["status_id"];

            $this->db->trans_start();

            $data = [
                "fieldArr" => [
                    "status_id" => $status_id,
                    $old_status_at_field => 0,
                    "updated_at" => time(),
                ],
                "whereArr" => [
                    "id" => $id,
                ],
            ];
            $this->order_model->updateData($data);

            $this->order_genzong_model->delData([
                "whereArr" => [
                    "order_id" => $id,
                    "status_id" => $old_status_id,
                ],
            ]);

            $flag = 1;
            $msg = "操作成功";

            $this->db->trans_complete();
        } catch (Exception $e) {
            $msg = $e->getMessage();
        }

        $outArr = array("flag" => $flag, "msg" => $msg);
        echo jsonEncode($outArr);
    }

    /*
     * 
     */

    function addGenjin() {

        try {

            #权限
            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_addGenjin"));

            $data["navName"] = "编辑";

            $language_id = $this->input->getInt("language_id", TRUE);
            if ($language_id <= 0) {
                $language_id = 1;
            }
            $data["language_id"] = $language_id;

            $id = $this->input->getInt("id", TRUE);
            $editData = $this->order_model->getDataById($id);
            if (empty($editData)) {
                throw new Exception("没有此数据");
            }

            $data["editData"] = $editData;

            $data["doAddUrl"] = $this->projectSet["url"]["doAddGenjin"];

            $this->layout->view($this->projectSet["file"]["view"] . '/addGenjin', $data);
        } catch (Exception $e) {
            show_error($msg = $e->getMessage(), $e->getCode() ? $e->getCode() : 200, "系统提示");
        }
    }

    /*
     * 
     */

    function doAddGenjin() {

        $flag = 0;
        $msg = "操作失败";

        try {

            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_addGenjin",));

            $language_id = $this->input->postInt("language_id", TRUE);
            if ($language_id <= 0) {
                throw new Exception("缺少语言版本");
            }
            $content = $this->input->postStr("content", TRUE);
            if ($content == "") {
                throw new Exception("请填上反馈内容");
            }
            $content = str_replace("\n", ">>>", $content);

            $id = $this->input->postInt("id", TRUE);

            $oldData = $this->order_model->getDataById($id);
            if (empty($oldData)) {
                throw new Exception("数据不存在");
            }
            $latest_genjin = $content;

            //以下要进行翻译
            if ($language_id == 1) {
                //转换
                $content_en = $content;

                //$fanyi_content=str_replace("\n", "|||", $content);

                $result = $this->baidu_fanyi_api_service->fanyi($content);
                if ($result["status_code"] == 1) {
                    if (!empty($result["data"]["trans_result"][0]["dst"])) {
                        //$content_en = str_replace("|#|", "\n", $result["data"]["trans_result"][0]["dst"]);
                        $content_en = $result["data"]["trans_result"][0]["dst"];
                    }
                }
            } else {
                $content_en = $content;
                //转换
                $content = $content_en;
                $result = $this->baidu_fanyi_api_service->fanyi($content_en, "en", "zh");
                if ($result["status_code"] == 1) {
                    if (!empty($result["data"]["trans_result"][0]["dst"])) {
                        //$content = str_replace("|#|", "\n", $result["data"]["trans_result"][0]["dst"]);
                        $content = $result["data"]["trans_result"][0]["dst"];
                    }
                }
            }


            $this->db->trans_start();

            $this->order_genjin_model->addData([
                "order_id" => $id,
                "language_id" => $language_id,
                "content" => $content,
                "content_en" => $content_en,
                "created_user_id" => $this->_adminInfo["id"],
                "created_at" => time(),
                "updated_at" => time(),
            ]);

            $this->order_model->updateData([
                "fieldArr" => [
                    "latest_genjin" => jsonEncode([
                        1 => $content,
                        2 => $content_en,
                    ]),
                    "updated_at" => time(),
                ],
                "whereArr" => [
                    "id" => $id,
                ],
            ]);

            $flag = 1;
            $msg = "操作成功";

            $this->db->trans_complete();
        } catch (Exception $e) {
            $msg = $e->getMessage();
        }

        $outArr = array("flag" => $flag, "msg" => $msg);
        echo jsonEncode($outArr);
    }

    /*
     * 
     */

    function viewGenjin() {

        #权限

        $data["navName"] = "查看订单商品";

        try {

            $this->check->checkPower(array("power" => $this->projectSet["file"]["power_name"] . "_view",));

            $order_id = $this->input->getInt("order_id", TRUE);
            $order = $this->order_model->getDataById($order_id);

            if (empty($order)) {
                throw new Exception("不存在的订单");
            }

            $language_id = $this->input->getInt("language_id", TRUE);
            if ($language_id <= 0) {
                $language_id = 1;
            }

            $is_ajax = $this->input->is_ajax_request();
            if ($is_ajax) {

                $dataList = $this->order_genjin_model->getData("where order_id=" . $order_id, 1, 0);
                foreach ($dataList as $k => $v) {
                    $dataList[$k]["created_at_alias"] = date("Y-m-d H:i:s", $v["created_at"]);

                    $dataList[$k]["content_tag"] = $language_id == 2 ? $v["content_en"] : $v["content"];
                }

                $result = [
                    "code" => 0,
                    "count" => count($dataList),
                    "data" => $dataList,
                    "msg" => ""
                ];
                echo jsonEncode($result);
                exit;
            }
            $data["base_url"] = $this->projectSet["url"]["viewGenjin"] . "&order_id=" . $order_id . "&language_id=" . $language_id;

            $this->layout->view($this->projectSet["file"]["view"] . '/viewGenjin', $data);
        } catch (Exception $e) {
            $msg = $e->getMessage();
            show_error($msg, 200, "系统提示");
        }
    }

}
